<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="format-detection" content="telephone=no, email=no"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>

</head>
<body>
<script>
    function obj(name,age,sex,boyfriend) {
        var obj=new Object();
        obj.name=name;
        obj.age=age;
        obj.sex=sex;
        obj.boyfriend=boyfriend;
        obj.say=function(){
            document.write("“早上么么哒，晚上真幸福！”");
        }
        return obj;
    }
    //小明今年18岁 性别：男 有男朋友 他说：“我会好好努力的！”
    var a=obj("小明",18,"男","男朋友");
   
    document.write(`${a.name}今年${a.age}岁  性别：${a.sex}   有${a.boyfriend}   他说：`)
   a.say();

</script>
</body>
</html>